//
//  ViewController.m
//  11102
//
//  Created by student on 16/2/29.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.scrollView.contentSize=CGSizeMake(320*6, 0);
    
    
    
    [self makeScrollViewImage:CGRectMake(0, 77, 320, 188) :@"1"];
    [self makeScrollViewImage:CGRectMake(320, 77, 320, 188) :@"2"];
    
    [self makeScrollViewImage:CGRectMake(320*2, 77, 320, 188) :@"3"];
    
    [self makeScrollViewImage:CGRectMake(320*3, 77, 320, 188) :@"4"];
    
     [self makeScrollViewImage:CGRectMake(320*4, 77, 320, 188) :@"5"];
     [self makeScrollViewImage:CGRectMake(320*5, 77, 320, 188) :@"6"];
    [self.view addSubview:self.scrollView];
}
-(void)makeScrollViewImage:(CGRect)frame :(NSString *)name
{
    UIImageView *imageView=[[UIImageView alloc]initWithFrame:frame];
    imageView.image=[UIImage imageNamed:name];
    [self.scrollView addSubview:imageView];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
